load("@io_bazel_rules_go//go:def.bzl", "go_library", "go_test")

go_library(
    name = "tests",
    srcs = [
        "command_filters.go",
        "data.go",
        "explain_test_util.go",
    ],
    importpath = "github.com/cockroachdb/cockroach/pkg/sql/tests",
    visibility = ["//visibility:public"],
    deps = [
        "//pkg/internal/sqlsmith",
        "//pkg/kv",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver/kvserverbase",
        "//pkg/roachpb",
        "//pkg/sql/sem/tree",
        "//pkg/storage",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/storageutils",
        "//pkg/util/syncutil",
        "@com_github_cockroachdb_errors//:errors",
        "@org_golang_x_text//cases",
        "@org_golang_x_text//language",
    ],
)

go_test(
    name = "tests_test",
    size = "enormous",
    srcs = [
        "allow_role_memberships_to_change_during_transaction_test.go",
        "autocommit_extended_protocol_test.go",
        "bank_test.go",
        "copy_file_upload_test.go",
        "deadlock_test.go",
        "drop_role_concurrent_session_test.go",
        "empty_query_test.go",
        "enum_test.go",
        "hash_sharded_test.go",
        "impure_builtin_test.go",
        "inverted_index_test.go",
        "kv_test.go",
        "main_test.go",
        "max_open_txns_test.go",
        "monotonic_insert_test.go",
        "random_schema_test.go",
        "rename_column_test.go",
        "repair_test.go",
        "rsg_test.go",
        "schema_changes_in_parallel_test.go",
        "search_path_test.go",
        "set_cluster_setting_interlock_test.go",
        "set_session_args_test.go",
        "show_commit_timestamp_test.go",
        "split_test.go",
        "system_table_test.go",
        "table_split_test.go",
        "tracing_sql_test.go",
        "truncate_test.go",
        "virtual_cluster_name_test.go",
        "virtual_table_test.go",
    ],
    data = glob(["testdata/**"]) + [
        "//c-deps:libgeos",  # keep
    ],
    embed = [":tests"],
    exec_properties = {"test.Pool": "large"},
    shard_count = 16,
    deps = [
        "//pkg/base",
        "//pkg/bench",
        "//pkg/ccl",
        "//pkg/cloud",
        "//pkg/cloud/impl:cloudimpl",
        "//pkg/config/zonepb",
        "//pkg/internal/rsg",
        "//pkg/internal/sqlsmith",
        "//pkg/jobs",
        "//pkg/jobs/jobspb",
        "//pkg/keys",
        "//pkg/kv",
        "//pkg/kv/kvpb",
        "//pkg/kv/kvserver",
        "//pkg/kv/kvserver/concurrency",
        "//pkg/roachpb",
        "//pkg/security/securityassets",
        "//pkg/security/securitytest",
        "//pkg/security/username",
        "//pkg/server",
        "//pkg/settings",
        "//pkg/settings/cluster",
        "//pkg/spanconfig",
        "//pkg/sql",
        "//pkg/sql/catalog",
        "//pkg/sql/catalog/bootstrap",
        "//pkg/sql/catalog/catpb",
        "//pkg/sql/catalog/descpb",
        "//pkg/sql/catalog/descs",
        "//pkg/sql/catalog/desctestutils",
        "//pkg/sql/catalog/lease",
        "//pkg/sql/catalog/systemschema",
        "//pkg/sql/catalog/tabledesc",
        "//pkg/sql/parser",
        "//pkg/sql/pgwire/pgcode",
        "//pkg/sql/randgen",
        "//pkg/sql/sem/builtins",
        "//pkg/sql/sem/builtins/builtinsregistry",
        "//pkg/sql/sem/eval",
        "//pkg/sql/sem/tree",
        "//pkg/sql/sessiondatapb",
        "//pkg/sql/stats",
        "//pkg/sql/types",
        "//pkg/storage",
        "//pkg/testutils",
        "//pkg/testutils/datapathutils",
        "//pkg/testutils/serverutils",
        "//pkg/testutils/skip",
        "//pkg/testutils/sqlutils",
        "//pkg/testutils/testcluster",
        "//pkg/util/allstacks",
        "//pkg/util/ctxgroup",
        "//pkg/util/ioctx",
        "//pkg/util/json",
        "//pkg/util/leaktest",
        "//pkg/util/log",
        "//pkg/util/randutil",
        "//pkg/util/ring",
        "//pkg/util/syncutil",
        "//pkg/util/timeutil",
        "//pkg/util/tracing",
        "//pkg/util/tracing/tracingpb",
        "//pkg/util/uuid",
        "@com_github_cockroachdb_cockroach_go_v2//crdb",
        "@com_github_cockroachdb_cockroach_go_v2//crdb/crdbpgx",
        "@com_github_cockroachdb_datadriven//:datadriven",
        "@com_github_cockroachdb_errors//:errors",
        "@com_github_google_btree//:btree",
        "@com_github_jackc_pgconn//:pgconn",
        "@com_github_jackc_pgx_v4//:pgx",
        "@com_github_jackc_pgx_v5//:pgx",
        "@com_github_kr_pretty//:pretty",
        "@com_github_lib_pq//:pq",
        "@com_github_stretchr_testify//assert",
        "@com_github_stretchr_testify//require",
        "@org_golang_x_sync//errgroup",
    ],
)
